package com.andy.eqm.server.dto;

import com.andy.eqm.server.game.GameUser;

import io.netty.buffer.ByteBuf;

/**
 * 同步物品
 * @author cuiwm
 */
public class AddBagMessage extends BaseMessage{
	
	GameUser user;
	Integer[] itemId;
	public AddBagMessage(GameUser user,Integer... itemId) {
		this.user = user;
		this.itemId = itemId;
	}
	
	@Override
	public void writeBody(ByteBuf buf) {
		buf.writeInt(itemId.length);
		for(int key:itemId){
			buf.writeInt(key);
			buf.writeInt(user.getGameInfo().item(key).intValue());
		}
	}


}